<include file="Public:title_top"/>
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>小程序后台资源管理系统</title>
    <link rel="shortcut icon" type="images/x-icon" href="__ROOT__/Public/Home/ico/ico.png">
    <meta name="description" content="">
    <meta name="author" content="">
<include file="Public:title_dn"/>

</head>
<body>
<button class="btn btn-lg btn-primary btn-info btn-block" onclick="add()">上架物品</button>
<!--客户信息-->
<form action="{:U('show')}" method="get" enctype="multipart/form-data" id="form">
    <table class="table table-bordered table-hover table-full">
        <input type="hidden" name="type" value="null" id="type"/>
        <foreach name="type" item="vv" key="kk">
            <tr class="foreach">
                <foreach name="vv" item="vvv" key="kkk">
                    <td style="text-align: center;">
                        <button class="btn btn-info" type="button" onclick="t({$vv[$kkk]['id']})">
                            {$vv[$kkk]['typename']}
                        </button>
                    </td>
                </foreach>
            </tr>
        </foreach>
    </table>
</form>
<table class="table table-bordered table-hover" id="re">
    <tr id="afterimg">
        <td colspan="{$goods['count']}" style="text-align: right">类别：{$goods[0]['type']|type}</td>
        <td></td>
    </tr>

    <foreach name="goods" item="vvb" key="kkb">
            {$vvb|img}
    </foreach>

</table>
<include file="Public:title_last"/>
<script type="text/javascript">
    function add() {
        window.location.href = "upload.html";
    }
    function t(e) {
        var text = document.getElementsByClassName('foreach');
        var type = document.getElementById('type');
        var form = document.getElementById('form');
        for (var a = 0; a < text.length; a++) {
            text[a].remove();
        }
        type.value = e;
        form.submit();
    }
    function kan(img) {
        document.getElementById('re').style = 'display:none;';
        var str = "<div style='text-align: center;width: 100%;' id='new'>" +
                "<img src=" + img + " alt='图片' width='100%' onclick='re()'/>" +
                "</div>";
        document.getElementById('form').insertAdjacentHTML('afterend', str);

    }
    function re() {
        document.getElementById('new').remove();
        document.getElementById('re').style = 'display:table;';
    }
</script>
</html>
